package br.com.stourados.perfil.client;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.ClickEvent;

public class Julgamento extends Composite {
	private Button btnSim;
	private Button btnNo;
	private Label lblSim;
	
	public Julgamento() {
		
		VerticalPanel verticalPanel = new VerticalPanel();
		initWidget(verticalPanel);
		verticalPanel.setHeight("24px");
		
		HorizontalPanel horizontalPanel = new HorizontalPanel();
		horizontalPanel.setStyleName("borderBottom");
		verticalPanel.add(horizontalPanel);
		horizontalPanel.setSize("398px", "36px");
		
		Label lblPergunta = new Label("Este estourado come lixo?");
		horizontalPanel.add(lblPergunta);
		lblPergunta.setSize("247px", "27px");
		
		btnSim = new Button("Sim");
		btnSim.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				if(btnSim.getText().equals("Sim")){
				lblSim.setVisible(true);
				btnSim.setText("Clear");
				btnNo.setVisible(false);
				}else{
					lblSim.setVisible(false);
					btnSim.setText("Sim");
					lblSim.setStyleName("sim");
					btnNo.setVisible(true);
				}
			}
		});
		
		lblSim = new Label("SIM");
		lblSim.setStyleName("sim");
		lblSim.setVisible(false);
		horizontalPanel.add(lblSim);
		lblSim.setSize("37px", "28px");
		horizontalPanel.add(btnSim);
		btnSim.setSize("45px", "28px");
		
		btnNo = new Button("N\u00E3o");
		btnNo.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				if(btnNo.getText().equals("N\u00E3o")){
				lblSim.setText("N\u00C3O");
				lblSim.setStyleName("no");
				lblSim.setVisible(true);
				btnNo.setText("Clear");
				btnSim.setVisible(false);
				}else{
					lblSim.setVisible(false);
					lblSim.setText("SIM");
					lblSim.setStyleName("sim");
					btnNo.setText("N\u00E3o");
					btnNo.setVisible(true);
					btnSim.setVisible(true);
				}
			}
		});
		horizontalPanel.add(btnNo);
		btnNo.setSize("45px", "28px");
	}

}
